﻿namespace jisuanqi
{
    public class operation
    {
        private double dbl_a = 0;
        private double dbl_b = 0;

        public double NumberA
        {
            get { return dbl_a; }
            set { dbl_a = value; }
        }

        public double NumberB
        {
            get { return dbl_b; }
            set { dbl_b = value; }
        }

        public virtual double get_result()
        {
            double result = 0;
            return result;
        }
    }

    internal class operation_16to10 : operation
    {
        public override double get_result()
        {
            double result = 0;
            int i = System.Convert.ToInt32(NumberB.ToString(), 16);

            result = i;
            return result;
        }
    }

    internal class operation_add : operation
    {
        public override double get_result()
        {
            double result = 0;
            result = NumberA + NumberB;
            return result;
        }
    }

    internal class operation_sub : operation
    {
        public override double get_result()
        {
            double result = 0;
            result = NumberA - NumberB;
            return result;
        }
    }

    /// <summary>
    /// 乘
    /// </summary>
    internal class operation_mul : operation
    {
        public override double get_result()
        {
            double result = 0;
            result = NumberA * NumberB;
            return result;
        }
    }

    internal class operation_div : operation
    {
        public override double get_result()
        {
            double result = 0;
            result = NumberA / NumberB;
            return result;
        }
    }
}